

import LayoutMain from '@/layout';
import setting from '@/setting';
let routePre = setting.routePre;

const meta = {
  auth: true,
};

const pre = 'algorithm_';

export default {
  path: routePre + '/algorithm',
  name: 'algorithm',
  header: 'algorithm',
  redirect: {
    name: `${pre}list`,
  },
  meta,
  component: LayoutMain,
  children: [
    {
      path: 'category',
      name: `${pre}Category`,
      meta: {
        auth: ['admin-algorithm-category-index'],
        footer: true,
        title: '算法分类',
      },
      component: () => import('@/pages/algorithm/category/index'),
    },
    {
      path: 'algorithm',
      name: `${pre}algorithm`,
      meta: {
        auth: ['admin-algorithm-algorithm-index'],
        footer: true,
        title: '算法',
      },
      component: () => import('@/pages/algorithm/algorithm/index'),
    },
    {
      path: 'algorithm/edit_params/:id?',
      name: `${pre}editAlgorithmParams`,
      meta: {
        title: '算法参数配置',
        auth: ['admin-algorithm-algorithm-editParams'],
        keepAlive: true,
        activeMenu: routePre + '/algorithm/edit_params',
      },
      component: () => import('@/pages/algorithm/algorithm/edit_params'),
    },
    {
      path: 'mall',
      name: `${pre}mall`,
      meta: {
        auth: ['admin-algorithm-mall-index'],
        footer: true,
        title: '算法商城',
      },
      component: () => import('@/pages/algorithm/mall/index'),
    },
    {
      path: 'mall/demonstrate/:id',
      name: `${pre}mall-demonstrate`,
      meta: {
        auth: ['admin-algorithm-mall-demonstrate'],
        footer: true,
        title: '算法商城-演示',
      },
      component: () => import('@/pages/algorithm/mall/demonstrate'),
    },
  ],
};
